package cn.bluethink.eguan.core.entity;

import java.io.Serializable;

import cn.bluethink.eguan.model.core.EgAcount;
import cn.bluethink.eguan.model.core.EgOType;
import cn.bluethink.eguan.model.core.EgObject;
import cn.bluethink.eguan.model.core.EgRole;
import cn.bluethink.eguan.model.core.EgUser;

/**
 * 驿馆伙计实体模型
 * 
 * @author 苏州中科蓝迪公司所有(c)2016-2021
 * @version 0.2.0
 * @brief 驿馆+（EGUAN）
 * @note 修订历史：1.liuxn于2018/10/18设计并构建初始版本v0.2.0
 *      1、wanglei于2018/11/09增加注释
 */
public class StaffEntity implements Serializable {
	private static final long serialVersionUID = -3614859167737377301L;

	private Long egid;
	
	private Long uid;

	private Integer role1;
	
	private Integer purview1;
	
	private String uname;
	
	private String avator;
	
	private Long posoid;
	
	private Integer posotype;
	
	/**
	 * 账户Id
	 */
	private Long acountId;
	
	/**
	 * 账户数目
	 */
	private Integer bt;
	
	private Integer skp;
	
	private Integer exp;
	
	public EgUser createUser() {
		EgUser user = new EgUser();
		user.setId(uid);
		user.setAvatar(avator);
		user.setName(uname);
		EgRole role = new EgRole(role1, null, purview1);
		user.setRole(role);
		if(posoid == 0) {
			user.setPos(new EgObject(0L, "驿馆江湖", new EgOType(EgOType.JIANGHU, "驿馆江湖")));
		} else {
			user.setPos(new EgObject(posoid, null, new EgOType(posotype, null)));
		}
		
		if(acountId != null) {
			if(bt == null) bt = 0;
			EgAcount acount = new EgAcount(acountId, null, bt);
			user.setAcount(acount);
		} else {
			user.setAcount(new EgAcount());
		}
		
		user.setSkp(skp);
		user.setExp(exp);
		return user;
	}
	
	public Long getEgid() {
		return egid;
	}

	public void setEgid(Long egid) {
		this.egid = egid;
	}

	public Long getUid() {
		return uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	public Integer getRole1() {
		return role1;
	}

	public void setRole1(Integer role1) {
		this.role1 = role1;
	}

	public Integer getPurview1() {
		return purview1;
	}

	public void setPurview1(Integer purview1) {
		this.purview1 = purview1;
	}

	public String getUname() {
		return uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	public String getAvator() {
		return avator;
	}

	public void setAvator(String avator) {
		this.avator = avator;
	}

	public Long getPosoid() {
		return posoid;
	}

	public void setPosoid(Long posoid) {
		this.posoid = posoid;
	}

	public Integer getPosotype() {
		return posotype;
	}

	public void setPosotype(Integer posotype) {
		this.posotype = posotype;
	}

	public Integer getBt() {
		return bt;
	}

	public void setBt(Integer bt) {
		this.bt = bt;
	}

	public Integer getSkp() {
		return skp;
	}

	public void setSkp(Integer skp) {
		this.skp = skp;
	}

	public Integer getExp() {
		return exp;
	}

	public void setExp(Integer exp) {
		this.exp = exp;
	}

	public Long getAcountId() {
		return acountId;
	}

	public void setAcountId(Long acountId) {
		this.acountId = acountId;
	}
	
}
